@echo off
setlocal

set EMCC="D:\Program Files\EmscriptenSDK\emsdk-main\upstream\emscripten\emcc"
set PROJECT_DIR=f:/Projects/CPP/TestWwiseWeb
set OUTPUT=%PROJECT_DIR%/WwiseModule.data

echo Building project...
%EMCC% ^
   "%PROJECT_DIR%/dummy.c" ^
   -s SINGLE_FILE=1 -s EXPORTED_FUNCTIONS="[/"_main/"]" ^
   --preload-file "%PROJECT_DIR%/Resources/Init.bnk"@"/Resources/Init.bnk" ^
   --preload-file "%PROJECT_DIR%/Resources/Main.bnk"@"/Resources/Main.bnk" ^
   --no-entry ^
   -o "%OUTPUT%"

if %errorlevel% neq 0 (
    echo Build failed with error code %errorlevel%
) else (
    echo Build succeeded
)

pause
endlocal